home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14656 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  58 lines

  1. Path: news.cs.utwente.nl!not-for-mail
  2. From: Angelo Starink <starink@cs.utwente.nl>
  3. Newsgroups: comp.lang.c++
  4. Subject: Another class/function pointer problem...
  5. Date: Mon, 01 Apr 1996 16:01:53 +0200
  6. Organization: University of Twente, Dept. of Computer Science
  7. Distribution: world
  8. Message-ID: <315FE1D1.E66@cs.utwente.nl>
  9. NNTP-Posting-Host: maas.cs.utwente.nl
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (X11; I; HP-UX A.09.01 9000/720)
  14.  
  15. Hi All!
  16.  
  17. Since I tried to use a callback function within an object, I'm
  18. suffering from the class/function pointer problem as well...
  19.  
  20. Using the "static" trick it seemed like the problem was solved
  21. but now I can't get reach my class member variables:
  22.  
  23. class Problem {
  24. public:
  25.  
  26.     static CALLBACK void fn(...,...,..);
  27.     HWND the_window_using_this_object;
  28.  
  29. };
  30.  
  31.  
  32. void CALLBACK Problem::fn(...,..) {
  33.     ::MessageBox(the_window_using_this_object,"Whatever...", "Don't
  34. care",MB_OK);
  35. }
  36.  
  37.  
  38.  
  39. The reason I need this is because I want to use callback functions for some
  40. audio stuff
  41. in Windows NT. In my opinion an object that is supposed to handle things
  42. about audio
  43. has no relation with a window:
  44.  
  45. Problem::OpenInput() {
  46.     waveInOpen(....,(DWORD) fn, 0, CALLBACK_FUNCTION);
  47.     ...
  48. }
  49.  
  50.  
  51. When I try to compile this, Visual C++ 2.0 says:
  52. "'Problem::the_window_using_this_object' does not specify an object"
  53.  
  54. Is there someone who has a solution to this problem?
  55. Thanks for your time,
  56.  
  57.     Stefan Jansen
  58.